.class final Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;
.super Ljava/lang/Object;
.source "GPSStatusView.kt"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->onLocationUpdate(Landroid/location/Location;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = null
.end annotation


# instance fields
.field final synthetic $location:Landroid/location/Location;

.field final synthetic this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;


# direct methods
.method constructor <init>(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;Landroid/location/Location;)V
    .locals 0

    iput-object p1, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    iput-object p2, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->$location:Landroid/location/Location;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public final run()V
    .locals 6

    .line 208
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iget-object v2, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v2}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getLastUpdate$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)J

    move-result-wide v2

    sub-long/2addr v0, v2

    const/16 v2, 0x12c

    int-to-long v2, v2

    cmp-long v4, v0, v2

    if-lez v4, :cond_a

    .line 209
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getStatus$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)Landroid/widget/TextView;

    move-result-object v0

    const-string v1, "N/A"

    if-eqz v0, :cond_0

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 210
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getHdop$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)Landroid/widget/TextView;

    move-result-object v0

    if-eqz v0, :cond_1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 211
    :cond_1
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getLatlon$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)Landroid/widget/TextView;

    move-result-object v0

    if-eqz v0, :cond_2

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v3, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->$location:Landroid/location/Location;

    invoke-virtual {v3}, Landroid/location/Location;->getLatitude()D

    move-result-wide v3

    invoke-static {v3, v4}, Ljava/lang/String;->valueOf(D)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, " / "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v3, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->$location:Landroid/location/Location;

    invoke-virtual {v3}, Landroid/location/Location;->getLongitude()D

    move-result-wide v3

    invoke-static {v3, v4}, Ljava/lang/String;->valueOf(D)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 212
    :cond_2
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getSpeed$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)Landroid/widget/TextView;

    move-result-object v0

    if-eqz v0, :cond_3

    iget-object v2, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->$location:Landroid/location/Location;

    invoke-virtual {v2}, Landroid/location/Location;->getSpeed()F

    move-result v2

    float-to-double v2, v2

    iget-object v4, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-virtual {v4}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;

    move-result-object v4

    const-string v5, "speed_unit"

    invoke-static {v2, v3, v5, v4}, Llt/noframe/gpsfarmguide/utils/UnitsHelper;->getAccuracyByPrefs(DLjava/lang/String;Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 213
    :cond_3
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getSatellites$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)Landroid/widget/TextView;

    move-result-object v0

    if-eqz v0, :cond_4

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 214
    :cond_4
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    invoke-static {v0, v1, v2}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$setLastUpdate$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;J)V

    .line 215
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getLastFix$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)Landroid/widget/TextView;

    move-result-object v0

    if-eqz v0, :cond_5

    iget-object v1, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v1}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getDateFormat$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)Ljava/text/SimpleDateFormat;

    move-result-object v1

    new-instance v2, Ljava/util/Date;

    iget-object v3, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v3}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getLastUpdate$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)J

    move-result-wide v3

    invoke-direct {v2, v3, v4}, Ljava/util/Date;-><init>(J)V

    invoke-virtual {v1, v2}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 216
    :cond_5
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getAccuracy$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)Landroid/widget/TextView;

    move-result-object v0

    if-eqz v0, :cond_6

    iget-object v1, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->$location:Landroid/location/Location;

    invoke-virtual {v1}, Landroid/location/Location;->getAccuracy()F

    move-result v1

    float-to-double v1, v1

    iget-object v3, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-virtual {v3}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;

    move-result-object v3

    const-string v4, "accuracy_unit"

    invoke-static {v1, v2, v4, v3}, Llt/noframe/gpsfarmguide/utils/UnitsHelper;->getAccuracyByPrefs(DLjava/lang/String;Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 217
    :cond_6
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->$location:Landroid/location/Location;

    invoke-virtual {v0}, Landroid/location/Location;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "setting text"

    invoke-static {v1, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 218
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->access$getLast_connected$p(Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;)Landroid/widget/TextView;

    move-result-object v0

    if-eqz v0, :cond_7

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v2, Landroid/os/Build;->BRAND:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, " "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    sget-object v2, Landroid/os/Build;->MODEL:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 220
    :cond_7
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->$location:Landroid/location/Location;

    invoke-virtual {v0}, Landroid/location/Location;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    const/4 v1, -0x1

    if-eqz v0, :cond_8

    const-string v2, "quality"

    invoke-virtual {v0, v2, v1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;I)I

    move-result v1

    :cond_8
    if-gez v1, :cond_9

    .line 222
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->onQualityChanged(Ljava/lang/Integer;)V

    goto :goto_0

    .line 224
    :cond_9
    iget-object v0, p0, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView$onLocationUpdate$2;->this$0:Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/widgets/gps/GPSStatusView;->onQualityChanged(Ljava/lang/Integer;)V

    :cond_a
    :goto_0
    return-void
.end method
